import request from '@/utils/request'

export function fetchRoleList(query) {
  return request({
    url: '/admin/v1/role/list',
    method: 'get',
    params: query
  })
}

export function fetchRoleSelectList(query) {
  return request({
    url: '/admin/v1/role/select',
    method: 'get'
  })
}

export function fetchRole(id) {
  return request({
    url: '/admin/v1/role/get',
    method: 'get',
    params: { id }
  })
}

export function createRole(data) {
  return request({
    url: '/admin/v1/role/create',
    method: 'post',
    data
  })
}

export function deleteRole(data) {
  return request({
    url: '/admin/v1/role/del',
    method: 'post',
    data
  })
}

export function fetchRouteList(query) {
  return request({
    url: '/admin/v1/route/tree',
    method: 'get',
    params: query
  })
}
